package com.mswyt.utils.test.jdbc;

import com.mswyt.utils.msDataSource.IMsRegisterDataSource;
import com.mswyt.utils.msDataSource.dto.MsDataSourceMsgDto;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Component;

import java.util.HashMap;
import java.util.Map;

/**
 * @ClassName: MyDataSourceMsgI
 * @Description:
 */
@Qualifier("myDataSourceMsg")
@Component
public class MyDataSourceMsg implements IMsRegisterDataSource {
    @Override
    public Map<String, MsDataSourceMsgDto> getDataSourceMsg() {
        HashMap<String, MsDataSourceMsgDto> map = new HashMap<>();
        //添加第一个主数据源，默认为主数据源
        MsDataSourceMsgDto db1 = new MsDataSourceMsgDto(
                "jdbc:mysql://10.88.15.37:3306/syncplant_ms?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&tinyInt1isBit=false&allowMultiQueries=true&serverTimezone=GMT%2B8&allowPublicKeyRetrieval=true&rewriteBatchedStatements=true",
                "root",
                "root",
                true);
        map.put("db1", db1);
        //第二个数据源
        MsDataSourceMsgDto db2 = new MsDataSourceMsgDto(
                "jdbc:mysql://10.44.2.3:3306/syncplant_ghsw_dev?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&tinyInt1isBit=false&allowMultiQueries=true&serverTimezone=GMT%2B8&allowPublicKeyRetrieval=true&rewriteBatchedStatements=true",
                "root",
                "root");
        map.put("db2", db2);

        return map;
    }
}
